//头部、底部 高度适应
$(function(){
	var h1=$(".header").height()
	var h2=$(".footer").height()
	var h3=$(".topBar").height()
	$(".content").css({"padding-top":h1+h3,"padding-bottom":h2})
})

//弹出框
function dialog(id,time,url,func,msg){
	$(id).show();
	$(".mask").show();
	var w = $(id).width()/2;
	var h = $(id).height()/2;
	$(id).css({"margin-left":"-"+w+"px","margin-top":"-"+h+"px"})
	if(time){
		setTimeout(function(){dialogClose(id)},time);
	}
	if(url){
		setTimeout(function(){dialogUrl(url);},time);
	}
	if(func){
		funcA = function(){dialogClose(id);func();}
	}else{
		funcA = function(){dialogClose(id);};
	}
	if(msg){
		$(id).find("#msg").html(msg);
	}
}
function dialogClose(id){
	$(".mask").hide();
	$(id).hide();
}
function dialogUrl(url) {
	window.location.href = url;
}
function noClose(){
	if(event.stopPropagation)
		event.stopPropagation();
	else
		event.cancelBubble = true;
}

//tab
function tab(c_class, c_active, ele){
	$(ele).siblings(".item").removeClass("on");
	$(ele).addClass("on");
	$(c_class).hide();
	$(c_active).show();
}

var funcA = null;
function dialogExecute(){
	funcA();
}
